/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.poss.api.domain;

import java.util.List;
import javax.persistence.*;

/**
 *
 * @author Lakmal
 */
@Entity
public class Role {
    private long roleId;
    private String roleName;
    private List<User> roleUsers;
    private List<Function> roleFunctions;

    @ManyToMany(targetEntity=Function.class, cascade=CascadeType.ALL, fetch=FetchType.LAZY) 
    public List<Function> getRoleFunctions() {
        return roleFunctions;
    }

    public void setRoleFunctions(List<Function> roleFunctions) {
        this.roleFunctions = roleFunctions;
    }        

    @Id
    @GeneratedValue
    public long getRoleId() {
        return roleId;
    }

    public void setRoleId(long roleId) {
        this.roleId = roleId;
    }

    @ManyToMany(mappedBy="userRoles")
    public List<User> getRoleUsers() {
        return roleUsers;
    }

    public void setRoleUsers(List<User> roleUserList) {
        this.roleUsers = roleUserList;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }
    
    
}
